package org.management.base.data;

/**
 * @title: CodeEnum
 * @description: 返回数据集状态编码
 * @author: jiangyan
 * @date:  2019/1/27
 */
public enum ResultCode {

	/**
	 * success请求成功 param_error 请求参数不符合要求 error 请求错误 access_denied 请求拒绝
	 */
	SUCCESS(200,"请求成功"),
	CREATED(201, "创建成功"),
	BAD_REQUEST(400,"请求参数不符合要求"),
	UNAUTHORIZED(401, "未授权"),
	FORBIDDEN(403,"请求拒绝"),
	NOT_FOUND(404,"资源不存在"),
	TOO_MANY_REQUESTS(429, "请求过多,请稍后请求"),
	ERROR(500,"业务系统发生异常");

	ResultCode(int code, String description) {
		this.code = code;
		this.description = description;
	}

	/**
	 * 状态码
	 */
	private Integer code;

	/**
	 * 状态码描述
	 */
	private String description;

	public Integer getCode() {
		return code;
	}

	public String getDescription() {
		return description;
	}

}
